package eerbaar.commons;

public class RGBA {

    private final int red;
    private final int green;
    private final int blue;
    private final double transparacy;

    public RGBA(int r, int g, int b) {
        this(r, g, b, 1);
    }

    public RGBA(int r, int g, int b, double transparacy) {
        this.red = r;
        this.green = g;
        this.blue = b;
        this.transparacy = transparacy;
    }

    private String formatTransparacy() {
        return "";
    }

    public int getBlue() {
        return this.blue;
    }

    public java.awt.Color getColor() {
        return new java.awt.Color(this.red, this.green, this.blue);
    }

    public int getGreen() {
        return this.green;
    }

    public int getRed() {
        return this.red;
    }

    public double getTransparacy() {
        return this.transparacy;
    }

    @Override
    public String toString() {
        String t = this.formatTransparacy();
        return "rgba(" + this.red + "," + this.green + "," + this.blue + ","
                + t + ")";
    }

    public RGBA transparacy(double transparacy) {
        return new RGBA(this.red, this.green, this.blue, transparacy);
    }

}
